package com.sds.shop.action;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sds.fw.mvc.Action;
import com.sds.fw.mvc.HttpUtil;
import com.sds.shop.dao.CategoryDAO;
import com.sds.shop.dao.MemDAO;
import com.sds.shop.vo.MemVO;

public class JoinAction extends Action {
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		
	MemDAO mdao = MemDAO.getInstance();
	MemVO mvo = new MemVO();
	request.setCharacterEncoding("euc-kr");
	String memId = request.getParameter("memId");
	String memNm = request.getParameter("memNm");
	String pwd = request.getParameter("pwd");
	String pwd_hint = request.getParameter("pwd_hint");
	String pwd_hint_ans = request.getParameter("pwd_hint_ans");
	String ssn = request.getParameter("ssn");
	String birth_dt = request.getParameter("birth_dt");
	String male_flg = request.getParameter("male_flg");
	String tel_no = request.getParameter("tel_no");
	String cell_no = request.getParameter("cell_no");
	String addr = request.getParameter("addr");
	String email = request.getParameter("email");
	String email_rcv_flg = request.getParameter("email_rcv_flg");
		
	mvo.setMemId(memId);
	mvo.setMemNm(memNm);
	mvo.setPwd(pwd);
	mvo.setPwdHint(pwd_hint);
	mvo.setPwdHintAns(pwd_hint_ans);
	mvo.setSsn(ssn);
	mvo.setBirthDt(birth_dt);
	mvo.setMaleFlg(male_flg);
	mvo.setTelNo(tel_no);
	mvo.setCellNo(cell_no);
	mvo.setAddr(addr);
	mvo.setEmail(email);
	mvo.setEmailRcvFlg(email_rcv_flg);
	
	
	mdao.insertMember(mvo);
	HttpUtil.forward(request, response, "/index.jsp");

}
}
